	<template>
		<view class="container">
			<uni-list>
				<uni-list-item v-for="item,index in list" :key="index" :title="item.name" :thumb="'/static'+item.icon"
					:note="item.type" clickable @click="toPage(item.id)" thumbSize="lg" :rightText="'￥'+item.price+'元'"
					:showArrow="true">
				</uni-list-item>
			</uni-list>
		</view>
	</template>

	<script>
		export default {
			data() {
				return {
					"list": []
				}
			},
			methods: {
				loadyun() {
					let classmates = uniCloud.database().collection('fooddb')
					classmates.get().then(res => {
						uni.showToast({
							icon: 'success',
							title: '加载成功'
						})
						console.log(res.result);
						this.list = res.result.data


					})
				},
				toPage(id) {
					uni.navigateTo({
						url: '../fooddetail/fooddetail?id=' + id
					})
				}
			},
			onLoad() {
				this.loadyun()
				console.log("onLoad");
				uni.showLoading({
					title: '加载中',
					mask: false
				});
			}
		}
	</script>

	<style>

	</style>